@extends('admin.layout')
@section('title')
        权限列表
@endsection
@section('body')
        <div class="widget-body">
                <form role="form" class="form-inline widget">
                        <div class="form-group">
                                <input type="text" name="name" placeholder="节点名称" class="form-control" value="{{$name}}">
                        </div>
                        <button class="btn btn-default" type="submit">搜索</button>
                        <button class="btn btn-default" type="button" onclick="location.href='{{action(NAMESPACE_ADMIN.'NodeController@getAdd')}}';">添加</button>
                </form>
                <div class="widget">
                        <table class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                        <th>菜单</th>
                                        <th>节点名称</th>
                                        <th>节点路径</th>
                                        <th>状态</th>
                                        <th>图标</th>
                                        <th>排序</th>
                                        <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $key=>$item)
                                        <tr>
                                                <td>{{$item['pname']}}</td>
                                                <td>{{$item['name']}}</td>
                                                <td>{{$item['url']}}</td>
                                                <td>@if($item['status']==1) 正常 @else 禁用  @endif</td>
                                                <td>@if(!empty($item['icon'])) <span class="menu-icon fa {{$item['icon']}}"></span> @endif</td>
                                                <td>{{$item['sort']}}</td>
                                                <td>
                                                        <a href="{{action(NAMESPACE_ADMIN.'NodeController@getEdit',['id'=>$item['id']])}}">修改</a>|<a href="#"   onclick="if(confirm('确认删除?')) location.href='{{action(NAMESPACE_ADMIN.'NodeController@getDel',['id'=>$item['id']])}}';">删除</a>
                                                </td>
                                        </tr>
                                @endforeach
                                </tbody>
                        </table>
                </div>
                <div class="widget">
                        <div class="pull-left">共{{ $data->total() }}条记录</div>
                        <div class="pull-right">{!! $data->appends($name)->render() !!}</div>
                        <div style="clear: both"></div>
                </div>
            </div>
        </div>
@endsection